#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
    int countPairs(vector<int>& nums, int k)
    {
	int res = 0;
	for (int i = 0, len = size(nums); i < len; ++i)
	    for (int j = i + 1; j < len; ++j) {
		if (nums[i] != nums[j]) continue;;
		if ((i * j) % k) continue;;
		res++;
	    };
	return res;
    }

private:
};

int main()
{
    [[maybe_unused]] Solution solution;
    return 0;
}
